Ext.define('Service.module.view.ModuleAddForm', {
    extend: 'Ext.form.Panel',

    id : 'Service_module_view_ModuleAddForm',
    alias : 'widget.Service_module_view_ModuleAddForm',
    
    layout: {        
        type: 'fit'
    },
    frame: true,
    bodyPadding: 8,
    title: '',

    initComponent: function() {
        var me = this;

        Ext.applyIf(me, {
        	style : {
    			border : 'none'
        	},
            items: [
                {
                    xtype: 'fieldset',
                    layout: {
                        columns: 2,
                        type: 'table'
                    },
                    title: '模块信息',
                    items: [
                    	{
                    		xtype: 'hiddenfield',
	                    	name : 'pname',
	                    	allowBlank: false,
	                    	colspan :2,
	                    	anchor: '100%',
	                    	height:0,
	                    	margin:0,
	                    	blankText: '父模块不能为空'
                    	},
                        {
                            xtype: 'textfield',
                            disabled: true,
                            margin: 10,
                            name: 'parentText',
                            fieldLabel: '所属模块',
                            allowBlank: false,
                            blankText: '父模块不能为空'
                        },
                        {
                            xtype: 'textfield',
                            margin: 10,
                            name: 'moduleName',
                            fieldLabel: '模块名称',
                            msgTarget: 'qtip',
                            allowBlank: false,
                            blankText: '模块名称不能为空',
                            vtype: 'alpha',
                            vtypeText: '模块名称为字母组合'
                        },
                        {
                            xtype: 'textfield',
                            margin: 10,
                            name: 'moduleText',
                            fieldLabel: '展示名称',
                            msgTarget: 'qtip',
                            allowBlank: false,
                            blankText: '展示名称不能为空'
                        },
                        {
                            xtype: 'combobox',
                            margin: 10,
                            name: 'moduleType',
                            fieldLabel: '模块类型',
                            msgTarget: 'qtip',
                            allowBlank: false,
                            valueField : 'value',
                            displayField : 'text',
                            forceSelection: true,
                            blankText: '模块类型不能为空',
                            emptyText : '请选择模块类型',
                            store: 'Service.module.store.ModuleTypeStore'
                        },
                        {
                            xtype: 'numberfield',
                            margin: 10,
                            name: 'sortIndex',
                            fieldLabel: '模块排序',
                            allowBlank: false,
                            blankText: '模块排序不能为空',
                            allowDecimals: false,
                            maxValue: 99999,
                            minValue: 1
                        },
                        {
                            xtype: 'textfield',
                            margin: 10,
                            name: 'serviceName',
                            fieldLabel: '服务名称'
                        },
                        {
                        	xtype: 'textfield',
                            margin: 10,
                            name: 'serviceCls',
                            fieldLabel: 'JS服务类'
                        },
                        {
                            xtype: 'textfield',
                            margin: 10,
                            name: 'codePath',
                            fieldLabel: 'CODEPATH',
                            emptyText: '代码路径'
                        },
                        {
                            xtype: 'textfield',
                            margin: 10,
                            colspan : 2,
                            name: 'tableName',
                            fieldLabel: '数据表名'
                        },
                        {
                            xtype: 'textareafield',
                            margin: 10,
                            colspan : 2,
                            name: 'remark',
                            fieldLabel: '描述信息',
                            colspan: 2,
                            width:530
                        }
                    ]
                }
            ],
            buttons : [
            	{
            		text : '提交',
            		module : 'module',
            		action : 'addModule',
            		plugins : [
            			SessionPermissionPlugin
            		]
            	},
            	{
            		text : '取消',
            		module : 'module',
            		action : 'cancelModuleAddForm'
            	}
            ]
        });

        me.callParent(arguments);
    }

});